{include file="../include.tpl"}
<body>
{literal}
<style>
#ulList{list-style:none; padding:0; margin:0;width:97%;}
#ulList li{float:left;width:110px;height:140px;position: relative;}
#ulList li img{width:100px;height:90px; cursor:pointer;}
#ulList li div{position:absolute; top:100px;left:5px;}
.tblFile td{border:#CCC 1px solid}
#filelist div{height:30px; line-height:30px;}
#viewDetail{ position:absolute;right:0px;top:0px;}
</style>
{/literal}
{if $roleId eq 3}
{include file='headerf.tpl'}
{else}
{include file='header.tpl'}
{/if}
 
<table width="1000" style="margin:auto;" border="0" cellpadding="0" cellspacing="0">
   
  <tr>
    <td height="71" valign="middle">&nbsp;</td>
    <td valign="top" ><table width="100%" height="138" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="13" valign="top">&nbsp;</td>
      </tr>
      <tr>
        <td valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
          
 
          <tr>
            <td>
            <div  class="ui-widget" style="width:100%;">
 
	<table id="users" width="100%" >
		<tbody>
         <tr>
              <td align="left" valign="top" width="100%">
                 <table width="100%">
                 <tr>
                 <td width="8"></td>
                 <td height="550" width="692" id="tdShowImg" align="center" style="text-align:center; position:relative;" valign="middle">
                 <img src="images/sddd.png" id="viewDetail" onClick="window.scroll(10000,window.document.body.scrollHeight);"/>
                 </td>
                 <td width="8"></td>
                 <td height="150" width="255px"align="center" style="text-align:center" valign="top">
                 <table width="100%" class="tblright" cellpadding="0" cellspacing="0">
                 <tr><td align="center" valign="top" style="border:1px #c5c6bd solid;">
                 <table width="225" cellpadding="0" cellspacing="0" >
 
                 <tr id="trBtnPost" style="display:none;"><td colspan="2" height="70"><button aria-disabled="false" role="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" id="btnDetailPost" style="height: 40px; width: 100%; font-size: 15px;"><span class="ui-button-text">发布</span></button></td></tr>
				 <tr id="trBtnHide" ><td colspan="2">&nbsp;</td>
                 <tr><td height="30" width="60">文件格式：</td><td id="info"></td></tr>
                 <tr><td height="30">文件大小：</td><td id="size"></td></tr>
                 {if $isShowPreview eq "1"}
                 <tr><td height="20" colspan="2"></td></tr>
                 <tr id="trPreview"><td colspan="2" style="background-color:#e9e8e4;padding-left:25px;cursor:pointer;"  height="50" align="left" onClick="doview();"><img src="images/view.png"/></td></tr>
                 {/if}
                 {if $isShowDown eq "1"}
                 <tr><td height="20" colspan="2"></td></tr>
                 <tr id="trDown"><td colspan="2" style="background-color:#e9e8e4;padding-left:25px;cursor:pointer;"  height="50" align="left" onClick="down(gId);"><img src="images/down.jpg"/></td></tr>
				 {/if}
                 <tr><td height="20" colspan="2"></td></tr>
                 <tr><td colspan="2" style="background-color:#e9e8e4;cursor:pointer;padding-left:25px;" height="50" align="left" onClick="fav(gId);"><img src="images/fav.jpg" /></td></tr>
                 {if $isShowEdit eq "1"}
                 <tr><td height="20" colspan="2"></td></tr>
                 <tr><td colspan="2" style="background-color:#e9e8e4;cursor:pointer;padding-left:25px;" height="20" align="left"><a href="?act=upload&showEdit={$id}" target="_blank">我要编辑</a></td></tr>
                 {/if}
                 <tr><td height="30" colspan="2"></td></tr>
                 </table>
                 </td></tr>
                 
                 <tr><td>
                 <table width="95%" cellpadding="0" cellspacing="0" style="color:#747474;">
                 <tr><td align="left" height="50">关键词:</td></tr>
                 <tr><td align="left" id="keywords">
                 </td></tr>
                 </table>
                 </td></tr>
 
                  
                 </table>
                 </td>
                 
                 </tr>
                <tr><td height="10" colspan="4" ></td></tr>
                 <tr>
                <td colspan="4" align="center" style="border-top:1px #aaaaaa dotted;;border-bottom:1px #aaaaaa dotted;">
                 <table width="90%" style="color:#9a9a9a;">
                 <tr><td height="30" align="right" colspan="4"></td></tr>
                 <tr><td height="30" align="right" width="100">文件名称:</td><td width="200" id="name">{$f.fid}</td><td align="right" width="100">作者:</td><td id="author">{$f.author}</td></tr>
                 <tr><td height="30" align="right">图片编号:</td><td id="idid">{$f.mark}</td><td align="right">使用限制:</td><td id="limitUse">{$f.limitUse}</td></tr>
                 <tr><td height="30" align="right">出处说明:</td><td id="instro">{$f.instro}</td><td align="right">使用时限:</td><td id="avaliDate">{$f.avaliDate}</td></tr>
                 <tr><td height="30" align="right">上传:</td><td id="uploader">{$f.uname}</td><td style="color:#597ddb;" align="right">专题:</td><td style="color:#597ddb;" id="zhuanTi">{$f.zhuanTi}</td></tr>
                 <tr><td height="30" align="right">创建时间:</td><td id="cyear">{$f.year}</td><td style="color:#597ddb;" align="right"></td><td style="color:#597ddb;" id="zhuanTi"></td></tr>
                 <tr><td height="30" align="right" colspan="4"></td></tr>
                 </table>
                </td>
                 </tr>
                 </table> 
              </td>
               
         </tr>
		</tbody>
	</table>
 
</div>
 </td>
          </tr>
        </table>
          </td>
      </tr>
    </table></td>
    <td >&nbsp;</td>
  </tr>
  <tr><td colspan="3" height="32"></td></tr>
  <tr>
    <td  colspan="3" valign="middle">
     {include file='footer.tpl'} 
    </td>
  </tr>
</table>
<form id="from2View" action="?act=main&op=view" target="_blank" method="post">
<input type="hidden" id="viewId" name="id"/>
</form>
<input type="hidden" id="isView" value="{$isShowPreview}"/>
</body>
 {literal}
<script type="text/javascript">
// Custom example logic
var gId =0;
function getQueryString(name) {
   var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)","i");
   var r = window.location.search.substr(1).match(reg);
   if (r!=null) return (r[2]); return null;
}
$(function() {
     //setHeaderPos("详细信息");
	 gId = getQueryString("id");
 
	 $.get("?act=ajax&op=getFileInfo&id="+gId,function(data){
		 
		 var j = eval("("+data+")");
		if(j.st=="ok")
		{
	 
			$("#tdShowImg").css("background-image","url("+j.data.path.replace("s.","sb.")+")");
			$("#tdShowImg").css("background-position","center");
			$("#tdShowImg").css("background-repeat","no-repeat");
			//$("#tdShowImg").css("background-size","contain");
			$("#author").append(j.data.author);
			$("#name").append(j.data.mark);
			setHeaderPos(j.data.mark);
			$("#idid").append(j.data.id);
			$("#instro").append(j.data.instro);
			$("#uploader").append(j.data.uname);
			$("#zhuanTi").append(j.data.zhuanTi);
			$("#limitUse").append(j.data.limitUse);
			$("#size").append(j.data.size);
			$("#keywords").html(j.data.keywords);
			$("#avaliDate").append(j.data.avaliDate+"  到期");
			$("#info").html(j.data.fileTypeName);
			$("#cyear").html(j.data.year);
			if(j.data.isPost!="1")
			{
				showPostButton();
			}
			if($("#isView").val()=="1")
			{
				$.get("?act=main&op=topdf&fid="+j.data.id,function(){});
 
				$("#viewId").val(j.data.id);
			}
		}
		else
		{
			//window.location.href="index.html";
		}
		 	 
		 });
	 });
function doview()
{
	 $("#from2View")[0].submit();
}
function showPostButton()
{
	var src = getQueryString("src");
if(src=="check")
{
	$("#trBtnPost").show();
	$("#trBtnHide").hide();

	$("#btnDetailPost").click(function(){
		headerShowTips("确定要发布吗",5);
		});
}
}
</script>
{/literal}
